package com.jiangxiaofei.citycloud.util;

import android.os.Environment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by JiangXFei on 2017/8/22.
 */

public class ImgUtils {
    public static String getFilePath(){
        String path= Environment.getExternalStorageDirectory().getPath()+"cityCloudImg";
        return path;
    }
    public static List<String> getImgs(String imgs) {
        List<String> imgList = new ArrayList<>();
        String[] split = imgs.split(",");
        for (int i = 0; i < split.length; i++) {
            imgList.add(split[i]);
        }
        return imgList;
    }

    public static String getImg(String imgs) {
        String[] split = imgs.split(",");
        return split[0];
    }

    public static String getImgsString(List<String> strs) {
        StringBuffer stringBuffer=new StringBuffer();
        for (int i = 0; i < strs.size(); i++) {
            stringBuffer.append(strs.get(i));
            if (i!=strs.size()-1){
                stringBuffer.append(",");
            }
        }
        return stringBuffer.toString();
    }
}
